/**
 * @typedef Resume
 * @property {string} content.required -文章标题
 * @property {string} themeColor.required -文章内容
 * @property {string} themeStyleName.required -文章分类
 */

const express = require('express')
const router = express.Router()
const auth = require('@/middleware/auth.middleware')
const resumeController = require('@/controllers/resume.controller')

/**
 * 创建简历
 * @route POST /resume/create
 * @group 简历管理
 * @param {Resume.model} resume.body.required
 * @returns {object} 200
 * @returns {Error}  default - Unexpected error
 * @security JWT
 */
router.post('/create', auth(), resumeController.createResume)

/**
 * 更新简历
 * @route POST /resume/update
 * @group 简历管理
 * @param {Resume.model} resume.body.required
 * @returns {object} 200
 * @returns {Error}  default - Unexpected error
 * @security JWT
 */
router.post('/update', auth(), resumeController.updateResume)

/**
 * 导出简历
 * @route POST /resume/export
 * @group 简历管理
 * @returns {object} 200
 * @returns {Error}  default - Unexpected error
 * @security JWT
 */
router.post('/export', auth(), resumeController.exportResume)

/**
 * 查询个人简历
 * @route GET /resume/find
 * @group 简历管理
 * @returns {object} 200
 * @returns {Error}  default - Unexpected error
 * @security JWT
 */
router.get('/find', auth(), resumeController.findResumeByUserId)

/**
 * 根据简历id查询简历
 * @route GET /resume/findById
 * @group 简历管理
 * @returns {object} 200
 * @returns {Error}  default - Unexpected error
 */
router.get('/findById', resumeController.findResumeById)

module.exports = router
